package com.itheima.reggie.domain;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.itheima.reggie.common.DemoDataListener;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

@Data
public class Employee implements Serializable {

    private static final long serialVersionUID = 1L;

    @ExcelProperty(value = "用户id")
    private Long id;
    @ExcelProperty(value = "账号名")
    private String username;

    @ExcelProperty(value = "用户名")
    private String name;
    @ExcelIgnore
    private String password;

    @ExcelProperty(value = "手机号")
    private String phone;
    @ExcelProperty(value = "性别")
    private String sex;
    @ExcelProperty(value = "身份证号")
    private String idNumber;
    @ExcelProperty(value = "状态")
    private Integer status;

    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ExcelProperty(value = "创建时间", converter = DemoDataListener.class)
    private LocalDateTime createTime;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ExcelProperty(value = "修改时间", converter = DemoDataListener.class)
    private LocalDateTime updateTime;

    @TableField(fill = FieldFill.INSERT)
    private Long createUser;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Long updateUser;

}
